# -*- coding: utf-8 -*-
# @Time    : 2021/3/22 20:50
# @Author  : tanxin
# @Email   : 1275841988@qq.com
# @File    : 作业 2021-3-19.py
# @Software: PyCharm

# 猜数字
# • 在程序内定义一个数字，让用户猜
# • 检查用户输入的是否为数字
# • 键盘接收用户输入，猜对或猜错都给出提示（大/小）
# • 最多能猜3次
# • 给出用户最终猜的结果，及花了几次来猜

# import random
# a=random.randint(1,10)
# for i in range(3):
#     num1 = input("猜数字:")
#     if num1.isdigit():
#       if num1==a:
#         print("恭喜猜对!")
#         break
#       elif int(num1)< a:
#         print("小")
#       elif int(num1)> a:
#         print("大")
#       if i==2:
#         print("谢谢惠顾!")
#         break
#       else:
#         print(f"你还有{2-i}次机会")
#     else:
#         print("非数字")
#         break
#


#打印100-500以内的质数（只能被1和自己整除的数）

# list = []
# for num1 in range(100,500):
#    for i in range(2,num1//2 + 1):
#       if num1%i == 0:
#          print(num1,"不是质数")
#          print(i,"乘以",num1//i,"是",num1)
#          break
#    else:
#       list.append(num1)
# print(list)


#打印1-50以内整数的和
# s=0
# for num1 in range(51):
#     s+=num1
# print(s)


#分数等级
# num1 = input("输入分数:")
# if num1.isdigit():
#   if int(num1) < 0 or int(num1) > 100:
#     print("输入不合法!")
#   if 85<=int(num1)<=100:
#       print("优秀")
#   elif 60<=int(num1)<85:
#       print("良好")
#   elif int(num1)<60:
#       print("不及格")
# else:
#     print("输入不合法!")
